<div class="clean_copy">
<?=$this->txt2html($cleanCode)?>
</div>
<ul role="tablist" class="nav nav-tabs">
	<li class="active" role="presentation">
		<a data-toggle="tab" role="tab" href="#translation_edit" >Edit</a>
	</li>
	<li role="presentation">
		<a data-toggle="tab" role="tab" href="#translation_history" >History</a>
	</li>
</ul>

<div class="tab-content">
	<div id="translation_history" class="tab-pane">
		<div class="translation_history tab-pane-inner">
		<?php
			if(is_array($history) && count($history) > 0)
			{
				echo '<table class="table table-bordered">';
				echo '<tr>
						<th>Message</th>
							<th>Status</th>
							<th>Time / Date</th>
						</tr>';
				echo '<tr>';
				echo '<td class="item_content">'. $this->txt2html($cleanCode) .'</td> <td> base code </td> <td></td>';
				echo '</tr>';
				foreach($history as $item)
				{
					$date = new DateTime();
					$date->setTimestamp($item['date']);
					$tranlateType = ($item['operationType'] == 3) ? '<span class="green">Approved</span>' : '<span class="blue">Draft</span>';
					echo '<tr>';
					echo '<td class="item_content">'. $this->txt2html($item['content']) .'</td> <td>'. $tranlateType .'</td> <td>'. $date->format('H:i:s') .' / '. $date->format('d.m.Y') .'</td>';
					echo '</tr>';
				}
				echo '</table>';
			}
		?>
		</div>
	</div>

	<div id="translation_edit" class="tab-pane active">
		<div class="panelFormBlock tab-pane-inner">
			<?php echo $form; ?>
		</div>
	</div>
</div>